Skip to main content

Unreal API


Setup

Free Engine

  • Summary: Free the engine instance
  • Inputs:
    • none
  • Outputs:
    • none
  • Example:
    FreeEngine

Initialize Engine

  • Summary: Initialize the engine instance
  • Inputs:
    • none
  • Outputs:
    • Return Value bool
  • Example:
    InitializeEngine

Init Audio

  • Summary: Initialize the given audio settings for the engine instance
  • Inputs:
    • Sample Rate float
    • Buffer Size float
  • Outputs:
    • none
  • Example:
    InitAudio

Load Bundle

  • Summary: Loads all assets of the given bundle, if it exists in the set bundle directory.
  • Inputs:
    • Bundle Name string
    • Threading Mode enum ThreadingMode { GameThreadSynchronous, PooledThreadAsync }
  • Outputs:
    • Error String string
  • Example:
    LoadBundle

Load Section

  • Summary: Loads all assets of the given section in a bundle, if it exists in the set bundle directory.
  • Inputs:
    • Bundle Name string
    • Section Name string
    • Threading Mode enum ThreadingMode { GameThreadSynchronous, PooledThreadAsync }
  • Outputs:
    • Error String string
  • Example:
    LoadSection

Load Playlist

  • Summary: Loads all tracks of the given playlist in a bundle, if it exists in the set bundle directory.
  • Inputs:
    • Bundle Name string
    • Playlist Name string
    • Threading Mode enum ThreadingMode { GameThreadSynchronous, PooledThreadAsync }
  • Outputs:
    • Error String string
  • Example:
    LoadPlaylist

Load Track

  • Summary: Loads the specified track of the given bundle, if it exists in the set bundle directory.
  • Inputs:
    • Bundle Name string
    • Track Name string
    • Threading Mode enum ThreadingMode { GameThreadSynchronous, PooledThreadAsync }
  • Outputs:
    • Error String string
  • Example:
    LoadTrack

Load Theme

  • Summary: Loads the specified theme of the given bundle, if it exists in the set bundle directory.
  • Inputs:
    • Bundle Name string
    • Theme Name string
    • Threading Mode enum ThreadingMode { GameThreadSynchronous, PooledThreadAsync }
  • Outputs:
    • Error String string
  • Example:
    LoadTheme

Remove Asset

  • Summary: Unloads the specified theme or track.
  • Inputs:
    • Asset Type enum AssetType { Track, Theme }
    • Id int
  • Outputs:
    • none
  • Example:
    RemoveAsset

Playback.Playlist


Playlist Get Current Beat

  • Summary: Gets the current beat from the beat-clock.
  • Inputs:
    • none
  • Outputs:
    • Return Value float
  • Example:
    GetCurrentBeat

Playlist Get Current Track Info

  • Summary: Gets the track info struct for the currently loaded track.
  • Inputs:
    • none
  • Outputs:
    • Out Track Info FReactionalTrackInfo
    • Return Value bool
  • Example:
    GetCurrentTrackInfo

Playlist Get Current Track Metadata

  • Summary: Gets the currently loaded tracks metadata as a string.
  • Inputs:
    • none
  • Outputs:
    • Return Value FString
  • Example:
    GetCurrentTrackMetadata

Playlist Get Track

  • Summary: Gets the currently loaded tracks index.
  • Inputs:
    • none
  • Outputs:
    • Return Value int
  • Example:
    GetTrack

Playlist Get Track ID

  • Summary: Gets the currently loaded tracks id in the engine.
  • Inputs:
    • none
  • Outputs:
    • Return Value int
  • Example:
    GetTrackID

Playlist Get Volume

  • Summary: Gets the current volume for the playlist.
  • Inputs:
    • none
  • Outputs:
    • Return Value float
  • Example:
    GetVolume

Playlist Set Volume

  • Summary: Sets the volume of the playlist.
  • Inputs:
    • Value float
  • Outputs:
    • none
  • Example:
    SetVolume

Playlist Is Loaded

  • Summary: Checks if any playlists or tracks are loaded.
  • Inputs:
    • none
  • Outputs:
    • Return Value bool
  • Example:
    IsLoaded

Playlist Play

  • Summary: Starts playback of the first loaded track.
  • Inputs:
    • Fade In Time float
  • Outputs:
    • none
  • Example:
    Play

Playlist Next

  • Summary: Plays the next track. Fading out and in if requested.
  • Inputs:
    • Fade Out Time float
    • Fade In Time float
  • Outputs:
    • none
  • Example:
    Next

Playlist Prev

  • Summary: Plays the previous track. Fading out and in if requested.
  • Inputs:
    • Fade Out Time float
    • Fade In Time float
  • Outputs:
    • none
  • Example:
    Prev

Playlist Play Track by Index

  • Summary: Plays the loaded track with the corresponding index if it exists. Fading from the previous one if requested.
  • Inputs:
    • Track Index int
    • Fade Out Time float
    • Fade In Time float
  • Outputs:
    • none
  • Example:
    PlayTrackByIndex

Playlist Play Track by Name

  • Summary: Plays the loaded track with the corresponding name if it exists. Fading from the previous one if requested.
  • Inputs:
    • Track Name FString
    • Fade Out Time float
    • Fade In Time float
  • Outputs:
    • none
  • Example:
    PlayTrackByName

Playlist Play Track by Track Info

  • Summary: Plays the loaded track with the corresponding track info if it exists. Fading from the previous one if requested.
  • Inputs:
    • Track Info FReactionalTrackInfo
    • Fade Out Time float
    • Fade In Time float
  • Outputs:
    • none
  • Example:
    PlayTrackByTrackInfo

Playlist Random

  • Summary: Plays a randomly selected loaded track. Fading from the previous one if requested.
  • Inputs:
    • Fade Out Time float
    • Fade In Time float
  • Outputs:
    • none
  • Example:
    Random

Playlist Stop

  • Summary: Gets the current state of the playlist.
  • Inputs:
    • Fade Out Time float
  • Outputs:
    • none
  • Example:
    Stop

Playlist Fade

  • Summary: Fades the volume of the playlist to the target amp over the fade time.
    The track will also stop playback once target is reached when Stop Finish is true.
  • Inputs:
    • Target float
    • Fade Time float
    • Offset float
    • Stop Finish bool
  • Outputs:
    • none
  • Example:
    Fade

Playlist State

  • Summary: Gets the current state of the playlist.
    • 0 = Stopped
    • 1 = Playing
    • 2 = Paused
  • Inputs:
    • none
  • Outputs:
    • Return Value int
  • Example:
    State

Playlist Get Num Tracks

  • Summary: Gets the number of loaded tracks.
  • Inputs:
    • none
  • Outputs:
    • Return Value int
  • Example:
    GetNumTracks

Playlist Set Track

  • Summary: Sets the currently selected track by engine id, can be used to set which track to play prior to playback.
  • Inputs:
    • Id int
  • Outputs:
    • none
  • Example:
    SetTrack

Playlist Unset Track

  • Summary: Sets the currently selected track to none.
  • Inputs:
    • none
  • Outputs:
    • none
  • Example:
    UnsetTrack

Playback.Theme


Theme Get Control

  • Summary: Gets the requested control from the current theme.
  • Inputs:
    • Control Name FString
  • Outputs:
    • Return Value float
  • Example:
    GetControl

Theme Get Controls

  • Summary: Gets all controls from the current theme.
  • Inputs:
    • none
  • Outputs:
    • Out TMap<FString, FReactionalControlInfo>&
  • Example:
    GetControls

Theme Set Control

  • Summary: Sets the value of one of the controls in the theme.
  • Inputs:
    • Control Name FString
    • Value float
  • Outputs:
    • none
  • Example:
    SetControl

Theme Get ID

  • Summary: Gets the loaded theme id from the engine.
  • Inputs:
    • none
  • Outputs:
    • Return Value int
  • Example:
    GetID

Theme Get Overridable Instruments

  • Summary: Gets the list of overridable instruments for the current theme.
  • Inputs:
    • none
  • Outputs:
    • Out TArray<FString>&
  • Example:
    GetOverridableInsturments

Theme Instrument Override

  • Summary: Overrides the instrument settings for the theme.
  • Inputs:
    • Instrument Name FString
    • Pulse Rate float
    • Pitch float
    • Velocity float
    • Active bool
    • Legato float
  • Outputs:
    • none
  • Example:
    InsturmentOverride

Theme Is Loaded

  • Summary: Checks if a theme is loaded.
  • Inputs:
    • none
  • Outputs:
    • Return Value bool
  • Example:
    IsLoaded

Theme Play

  • Summary: Starts playback of the set theme.
  • Inputs:
    • none
  • Outputs:
    • none
  • Example:
    Play

Theme Reset

  • Summary: Resets the currently loaded theme.
  • Inputs:
    • none
  • Outputs:
    • none
  • Example:
    Reset

Theme Stop

  • Summary: Stops playback of the theme.
  • Inputs:
    • none
  • Outputs:
    • none
  • Example:
    Stop

Theme State

  • Summary: Gets the current state of the theme.
    • 0 = Stopped
    • 1 = Playing
    • 2 = Paused
  • Inputs:
    • none
  • Outputs:
    • Return Value int
  • Example:
    State

Theme Trigger State

  • Summary: Triggers the given state in the theme.
  • Inputs:
    • State Name FString
  • Outputs:
    • none
  • Example:
    TriggerState

Theme Trigger Stinger Float

  • Summary: Triggers the given state in the theme.
  • Inputs:
    • State Name FString
    • Value float
  • Outputs:
    • none
  • Example:
    TriggerStingerFloat

Theme Trigger Stinger Quant

  • Summary: Triggers the given state in the theme.
  • Inputs:
    • State Name FString
    • Quant EReactionalQuantizationValue
  • Outputs:
    • none
  • Example:
    TriggerStingerQuant

Theme Get Volume

  • Summary: Gets the currently set theme volume.
  • Inputs:
    • none
  • Outputs:
    • Return Value float
  • Example:
    GetVolume

Theme Set Volume

  • Summary: Sets the volume of the theme.
  • Inputs:
    • Value float
  • Outputs:
    • none
  • Example:
    SetVolume

Theme Fade

  • Summary: Fades the volume of the theme to the target amp over the fade time.
    The theme will also stop playback once target is reached when Stop Finish is true.
  • Inputs:
    • Target float
    • Fade Time float
    • Offset float
    • Stop Finish bool
  • Outputs:
    • none
  • Example:
    Fade

Theme Set Theme

  • Summary: Sets the currently set theme to the one corresponding to the id.
    • Note: The theme needs to be loaded in prior.
  • Inputs:
    • Id int
  • Outputs:
    • none
  • Example:
    SetTheme

Theme Unset Theme

  • Summary: Removes the active theme from the engine without unloading it from memory.
  • Inputs:
    • none
  • Outputs:
    • none
  • Example:
    UnsetTheme

Theme Get Current Theme Info

  • Summary: Gets the info struct for the currently active theme.
  • Inputs:
    • none
  • Outputs:
    • Out Theme Info FReactionalThemeInfo&
    • Return Value bool
  • Example:
    GetCurrentThemeInfo

Music System

Music System Beats to Seconds

  • Summary: Converts beats to seconds in the engine.
  • Inputs:
    • Beats float
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Music System Get Current Beat

  • Summary: Gets the current beat from the beat-clock.
  • Inputs:
    • none
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Music System Get Current Micro Beat

  • Summary: Gets the current microbeat from the beat-clock.
  • Inputs:
    • none
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Music System Get Next Beat

  • Summary: Gets the next beat from the set quantization value.
  • Inputs:
    • Quant float
    • Offset float
    • Theme bool
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Music System Get Next Beat Absolute

  • Summary: Gets the next microbeat from the set quantization value.
  • Inputs:
    • Quant float
    • Offset float
    • Theme bool
  • Outputs:
    • Return Value int64
  • Example:
    BeatsToSeconds

Music System Get BPM

  • Summary: Gets beats per minute of the playing track or theme.
  • Inputs:
    • none
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Music System Get Real Time To Beat

  • Summary: Gets the time remaining in seconds until the next beat from set quantized value.
  • Inputs:
    • Quant float
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Music System Get Time To Beat

  • Summary: Gets the time remaining until the next beat from set quantized value.
  • Inputs:
    • Quant float
    • Offset float
    • Theme bool
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Music System Schedule Audio

  • Summary: Schedules sound to play on a beat according to set quantized value.
  • Inputs:
    • Sound USoundBase
    • Quant float
    • Time Offset float
  • Outputs:
    • none
  • Example:
    BeatsToSeconds

Music System Subscribe to Quantization Event

  • Summary: Binds an event to a quantized value which will trigger during playback.
  • Inputs:
    • Quant float
    • OnQuantizationEvent const FReactionalQuantizationEvent&
  • Outputs:
    • none
  • Example:
    BeatsToSeconds

Music System Wait For Next Beat

  • Summary: Delay until next desired beat.
  • Inputs:
    • Beats float
    • Offset float
  • Outputs:
    • none
  • Example:
    BeatsToSeconds

Music System Duck Music

  • Summary: Ducks the music to the desired Amp value.
  • Inputs:
    • Amp float
  • Outputs:
    • Return Value float
  • Example:
    BeatsToSeconds

Events

Via the Subsystem you have the opportunity to subscribe to delegates functions, that will trigger on events. This has an added benefit in that we can listen in on said communication, and also communicate directly with the various features, as a sort of low level API. The most common use case would be to listen for "noteon", and "noteoff" messages generated by the engine.

On Audio Start

  • Summary: Fires when playback starts.
  • Outputs:
    • none
  • Example: OnAudioStart

On Audio End

  • Summary: Fires when playback stops, this would fire at the end of a track.
  • Outputs:
    • none
  • Example: OnAudioEnd

On Note On

  • Summary: Fires every time a note is played by the current theme.
  • Outputs:
    • Offset float
    • Sink int
    • Lane int
    • Pitch float
    • Velocity float
  • Example: OnNoteOn

On Note Off

  • Summary: Fires every time a note ends in the current theme.
  • Outputs:
    • Offset float
    • Sink int
    • Lane int
    • Pitch float
    • Velocity float
  • Example: OnNoteOff

On Part

  • Summary: Fires when a new part section starts, this is normally every bar even when no part change has happened.
  • Outputs:
    • Offset float
    • Sink int
    • Lane int
    • Part Index int
  • Example: OnPart

On Bar Beat Event

  • Summary: Fires every beat during playback.
  • Outputs:
    • Offset float
    • Bar int
    • Beat int
  • Example: OnBarBeatEvent

Components


Get Audio Component

  • Summary: Get the internal audio component
  • Inputs:
    • Target UReactionalSubsystem
  • Outputs:
    • Return Value UAudioComponent
  • Example: GetAudioComponent

Get Synth Component

  • Summary: Get the internal synth component used in the Synth Component Audio Render Mode.
  • Inputs:
    • Target UReactionalSubsystem
  • Outputs:
    • Return Value USynthComponent
  • Example: GetSynthComponent